from django.db import models
# Create your models here.
class BlogType(models.Model):
    Id = models.AutoField(primary_key=True)
    Name = models.CharField(max_length=20)
    Title = models.CharField(max_length=50)
    Count = models.IntegerField()
    def __unicode__(self):
        return self.Name

class Blogs(models.Model):
    Id = models.AutoField(primary_key=True)
    Title = models.CharField(max_length=200)
    Img = models.CharField(max_length=200)
    Des = models.CharField(max_length=300)
    Content = models.TextField()
    Type = models.ForeignKey('BlogType')   
    Time = models.DateTimeField(auto_now_add=True)
    def __unicode__(self):
        return self.Title

class User(models.Model):
    UserName = models.CharField(max_length=50)
    PassWord = models.CharField(max_length=50)
    def __unicode__(self):
        return self.UserName
    
        